﻿// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// This file is part of CodingEditor.
// Note:	This project is derived from Peter Project
//			(hosted on sourceforge and codeplex)
//
// Copyright (c) 2008-2009, CE Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


namespace CE.API
{
    using System.Drawing;
    using System.Windows.Forms;

    using WeifenLuo.WinFormsUI.Docking;

	/// <summary>
	/// Features a CE plugin must implement
	/// </summary>
    public interface ICEPlugin
    {
        #region Properties

        /// <summary>
        /// Gets if the Plugin can load files or not...
        /// </summary>
        bool AbleToLoadFiles
        {
            get;
        }

        /// <summary>
        /// The Author of the Plugin...
        /// </summary>
        string Author
        {
            get;
        }

        /// <summary>
        /// Does this plugin have a menu item for the context menu...
        /// </summary>
        bool HasContextMenu
        {
            get;
        }

        /// <summary>
        /// Does this plugin have a menu item for the plugin menu...
        /// </summary>
        bool HasMenu
        {
            get;
        }

        /// <summary>
        /// Does this plugin have a menu item for the tab menu...
        /// </summary>
        bool HasTabMenu
        {
            get;
        }

        /// <summary>
        /// Gets or Sets the Host Appliction Interface...
        /// </summary>
        ICEPluginHost Host
        {
            get; set;
        }

        /// <summary>
        /// This is the Name of the plugin...
        /// </summary>
        string Name
        {
            get;
        }

        /// <summary>
        /// Gets the Option Panel to add to the Main Option Dialog...
        /// </summary>
        /// <returns>Option Panel Control.</returns>
        Control OptionPanel
        {
            get;
        }

        /// <summary>
        /// The Image for the Plugin...
        /// </summary>
        Image PluginImage
        {
            get;
        }

        /// <summary>
        /// Gets the Type of the Plugin...
        /// </summary>
        CEPluginWindowType Type
        {
            get;
        }

        /// <summary>
        /// The Version of the Plugin...
        /// </summary>
        string Version
        {
            get;
        }

        bool IsCompatible
        {
            get;
        }

        #endregion Properties

        #region Methods

        /// <summary>
        /// Occurs when the Active Content has changed...
        /// </summary>
        /// <param name="tab">Active Content</param>
        void ActiveContentChanged(IDockContent tab);

        /// <summary>
        /// Occurs when the Apply button on the options dialog is pressed...
        /// </summary>
        void ApplyOptions();

        /// <summary>
        /// Checks the content string when loading Application...
        /// </summary>
        /// <param name="content">Content String</param>
        /// <returns>True if Match, other wise false</returns>
        bool CheckContentString( string content);

        /// <summary>
        /// This method is called when CodingEditor Closes...
        /// </summary>
        void Close();

        /// <summary>
        /// Gets the Starting Content...
        /// </summary>
        /// <param name="content">Content String</param>
        /// <returns>The Newly created content</returns>
        IDockContent GetContent( string content);

        /// <summary>
        /// Gets the Context Menu Items...
        /// </summary>
        /// <returns>Tool Strip Menu Item Array</returns>
        ToolStripMenuItem[] GetContextMenu();

        /// <summary>
        /// Gets the Plugin Menu Item...
        /// </summary>
        /// <returns>Tool Strip Menu Item</returns>
        ToolStripMenuItem GetMenu();

        /// <summary>
        /// Gets the Tab Menu Items...
        /// </summary>
        /// <returns>Tool Strip Menu Item Array</returns>
        ToolStripMenuItem[] GetTabMenu();

        /// <summary>
        /// Loads the Given File...
        /// </summary>
        /// <param name="filePath">Path to file to load.</param>
        /// <returns>True if Loaded, otherwise false</returns>
        bool LoadFile( string filePath);

        /// <summary>
        /// This method is called when the plugin is loaded...
        /// </summary>
        void Start();

        #endregion Methods
    }
}